###########################################
#Makefile for simple programs
###########################################
INC= -I/usr/local/curl/include -I./json/include -I./ocr/ -I./threadpool/
LIB= -L/usr/local/curl/lib 


CC=g++
CC_FLAG=-Wall -g -D_LIBC_REENTRANT 

PRG=iserver
OBJ=server.o http/httpclient.o log/writelog.o threadpool/command.o threadpool/thread_process.o threadpool/thread_pool.o
LDFLAGS= -lpthread -lrt -lssl /usr/local/curl/lib/libcurl.a ./json/libjson.a ./ocr/libocr.so 


$(PRG):$(OBJ)
	$(CC) $(CC_FLAG)  $(INC) $(LIB) -o $@ $(OBJ) $(LDFLAGS)
		
.SUFFIXES: .c .o .cpp
.cpp.o:
	 $(CC) $(CC_FLAG) $(INC) -c $*.cpp -o  $*.o

.PRONY:clean
clean:
	@echo "Removing linked and compiled files......"
	rm -f $(OBJ) $(PRG)
